﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities
{
    partial class Line : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "PointID":
                   {
                       return typeof(int);
                   }
                case "Point":
                   {
                       return typeof(Point?);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Line _instance = instance as Line;
            switch (name)
            {                
                case "PointID":
                   {
                       return _instance.PointID;
                   }
                case "Point":
                   {
                       return _instance.Point;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Line _instance = instance as Line;
            switch (name)
            {                
                case "PointID":
                    {
                        _instance.PointID = (int)value;
                        return;
                    }
                case "Point":
                    {
                        _instance.Point = (Point?)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Line();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Line>();
        }

        #endregion
    }
}
